﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class ComponentCategorySerialization : ComponentChildren {

		[Test]
		public void DefaultCategory() {
			Guid id = Guid.NewGuid();
			Category category = new Category(id, "Qualifier");
			component.Category.Add(category);

			string expected = string.Format(baseXml, string.Format(@"<Category Id=""{0}"" Qualifier=""Qualifier"" />", id.ToString().ToUpper()));

			Assertion(expected, project);
		}

		[Test]
		public void AllAttributes() {
			Guid id = Guid.NewGuid();
			Category category = new Category(id, "Qualifier");
			category.AppData = "AppDate";
			category.Feature = "Feature";
			component.Category.Add(category);

			string expected = string.Format(baseXml, string.Format(@"<Category Id=""{0}"" AppData=""AppDate"" Feature=""Feature"" Qualifier=""Qualifier"" />", id.ToString().ToUpper()));

			Assertion(expected, project);
		}
	}
}
